package com.cloudfun.campusshare.entity;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.time.LocalDateTime;

/**
 * 微信免密支付
 * Created by Huqin on 2020/4/20
 */
@Data
@Entity
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "wechat_contract")
public class WeChatContractEntity extends BaseEntity {

    @Id
    @GenericGenerator(name = "id_uuid", strategy = "uuid")
    @GeneratedValue(generator = "id_uuid")
    @Column(unique = true, columnDefinition = ("varchar(40) not null comment '主键uuid'"))
    private String id;

    @Column(columnDefinition = ("varchar(32) not null comment '微信支付分配的商户号'"))
    private String merchantId;

    @Column(columnDefinition = ("varchar(32) not null comment '签约协议号'"))
    private String contractCode;

    @Column(columnDefinition = ("varchar(32) not null comment '协议模板id'"))
    private String planId;

    @Column(columnDefinition = ("varchar(128) not null comment '微信用户标识'"))
    private String openId;

    @Column(unique = true, columnDefinition = ("varchar(40) not null comment '客户id'"))
    private String customerId;

    @Column(columnDefinition = ("timestamp(6) not null comment '操作时间'"))
    private LocalDateTime operateTime;

    @Column(columnDefinition = ("varchar(32) not null comment '委托代扣协议id'"))
    private String contractId;

}
